global terrainSO, screenDimensions, screenTileSize
maxX = screenDimensions[1]
maxY = screenDimensions[2]
wTile = 0
repeat with whichY = 1 to maxY
repeat with whichX = 1 to maxX
wSprite = terrainSO + wTile
puppetSprite(wSprite, 1)
set the member of sprite wSprite to "Iron Block"
set the loc of sprite wSprite to point((whichX - 1) * screenTileSize, (whichY - 1) * screenTileSize)
wTile = wTile + 1
end repeat
end repeat
end
on repositionTerrain
global terrainSO, screenDimensions, screenTileSize, playerViewpoint, rumbleOffset
viewOff = point(playerViewpoint[1] mod screenTileSize, playerViewpoint[2] mod screenTileSize)
maxX = screenDimensions[1]
maxY = screenDimensions[2]
wTile = 0
repeat with whichY = 1 to maxY
repeat with whichX = 1 to maxX
wSprite = terrainSO + wTile
set the loc of sprite wSprite to point((whichX - 1) * screenTileSize, (whichY - 1) * screenTileSize) - viewOff + (screenTileSize / 2) + rumbleOffset
wTile = wTile + 1
end repeat
end repeat
end
on checkSolidpoint pointLoc
global terrainData_Type, screenTileSize, playerViewpoint, terrainRef
tilePointSet = (pointLoc / screenTileSize) + 1
if (tilePointSet[2] >= 1) and (tilePointSet[2] <= count(terrainData_Type)) and (tilePointSet[1] >= 1) and (tilePointSet[1] <= count(terrainData_Type[1])) then
global terrainData_Type, screenTileSize, playerViewpoint, locksOpened, terrainRef, playerInventory
tilePointSet = (punchPoint / screenTileSize) + 1
if (tilePointSet[2] >= 1) and (tilePointSet[2] <= count(terrainData_Type)) and (tilePointSet[1] >= 1) and (tilePointSet[1] <= count(terrainData_Type[1])) then